package com.server.common.logistics.postal;

import com.google.gson.annotations.SerializedName;
import com.server.common.logistics.response.LogisticsResponse;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.ObjectUtils;

@NoArgsConstructor
@Data
public class PostalResponse<T> extends LogisticsResponse {
    @SerializedName("code")
    private String code;
    @SerializedName("msg")
    private String msg;
    @SerializedName("data")
    private T data;

    @Override
    public Boolean responseOk() {
        return "OK".equals(code);
    }

    @Override
    public Boolean dataEmpty() {
        return ObjectUtils.isEmpty(data);
    }
}
